/* jshint indent: 1 */

module.exports = function(sequelize, DataTypes) {
	return sequelize.define('user', {
		user_id: {
			type: DataTypes.BIGINT,
			allowNull: false,
			primaryKey: true,
			autoIncrement: true
		},
		email: {
			type: DataTypes.STRING,
			allowNull: true
		},
		phone: {
			type: DataTypes.STRING,
			allowNull: true
		},
		password: {
			type: DataTypes.STRING,
			allowNull: true
		},
		user_img: {
			type: DataTypes.STRING,
			allowNull: true
		},
		nick_name: {
			type: DataTypes.STRING,
			allowNull: true
		},
		role: {
			type: DataTypes.STRING,
			allowNull: true
		},
		user_status: {
			type: DataTypes.INTEGER(1),
			allowNull: false
		},
		last_login_ip: {
			type: DataTypes.STRING,
			allowNull: true
		},
		gmt_last_login: {
			type: DataTypes.DATE,
			allowNull: true
		},
		gmt_create: {
			type: DataTypes.DATE,
			allowNull: false
		},
		gmt_modified: {
			type: DataTypes.DATE,
			allowNull: false
		}
	}, {
		tableName: 'f_user',
		timestamps: false,
		freezeTableName: false
	});
};
